package com.iafme.dto.res;

import cn.zhxu.bs.bean.DbField;
import cn.zhxu.bs.bean.SearchBean;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @author summer
 * @version 1.0
 * @date 2025/3/28 10:16
 */
@Data
@SearchBean(tables = "iafme_order o LEFT JOIN iafme_order_course i ON o.id=i.order_id " +
        "LEFT JOIN iafme_course c ON i.course_id=c.id " +
        "LEFT JOIN iafme.iafme_member im on o.memberId=im.id",groupBy = "o.id")
public class AdmissionTicketResDTO implements Serializable {

    @DbField("o.id")
    private Integer id;

    @DbField("im.name")
    private String name;

    @DbField("o.admissionNum")
    private String admissionNum;

    @DbField("CONCAT(im.surname,' ',im.egName)")
    private String egName;

    @DbField("im.idCard")
    private String idCard;

    @DbField("GROUP_CONCAT(c.name SEPARATOR '  ')")
    private String courseName;

    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DbField("c.courseDate")
    private Date courseDate;

    @DbField("o.project_id")
    private Integer projectId;

    @DbField("o.session_id")
    private Integer showingsId;

    @DbField("o.level_id")
    private Integer levelId;

    @DbField("o.memberId")
    private Integer memberId;
}
